package com.yaoyong.codegenerator.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 路径封装实体模型
 *
 * @author 姚勇
 */
@Component
@ConfigurationProperties(prefix = "code.generator.path")
public class PathProperties {

    /**
     * 模板路径
     */
    private String baseTemplatePath;
    /**
     * 工程级模板路径
     */
    private String projectTemplatePath;
    /**
     * 表级模板路径
     */
    private String tableTemplatePath;
    /**
     * 列级模板路径
     */
    private String columnTemplatePath;
    /**
     * 代码生成路径
     */
    private String codeGeneratorPath;
    /**
     * 包名转换路径:
     * com.yao.model -> com/yao/model
     */
    private String packagePath;
    /**
     * 层级路径,包名替换路径:
     * path_1 代表一级包名
     * path_2 代表二级包名
     * ...
     */
    private Map<String, String> hierarchyPath = new HashMap<>();

    public String getBaseTemplatePath() {
        return baseTemplatePath;
    }

    public PathProperties setBaseTemplatePath(String baseTemplatePath) {
        this.baseTemplatePath = baseTemplatePath;
        return this;
    }

    public String getProjectTemplatePath() {
        return projectTemplatePath;
    }

    public PathProperties setProjectTemplatePath(String projectTemplatePath) {
        this.projectTemplatePath = projectTemplatePath;
        return this;
    }

    public String getTableTemplatePath() {
        return tableTemplatePath;
    }

    public PathProperties setTableTemplatePath(String tableTemplatePath) {
        this.tableTemplatePath = tableTemplatePath;
        return this;
    }

    public String getColumnTemplatePath() {
        return columnTemplatePath;
    }

    public PathProperties setColumnTemplatePath(String columnTemplatePath) {
        this.columnTemplatePath = columnTemplatePath;
        return this;
    }

    public String getCodeGeneratorPath() {
        return codeGeneratorPath;
    }

    public PathProperties setCodeGeneratorPath(String codeGeneratorPath) {
        this.codeGeneratorPath = codeGeneratorPath;
        return this;
    }

    public String getPackagePath() {
        return packagePath;
    }

    public PathProperties setPackagePath(String packagePath) {
        this.packagePath = packagePath;
        return this;
    }

    public Map<String, String> getHierarchyPath() {
        return hierarchyPath;
    }

    public PathProperties setHierarchyPath(Map<String, String> hierarchyPath) {
        this.hierarchyPath = hierarchyPath;
        return this;
    }
}
